-- grytole@gmail.com 02-Jul-2012

print('Running metro test')

sdl.init( {w = 280, h = 450, bpp = 32}, 'Metro test' )

isok, tile = sdl.fill( {w = 100, h = 100}, {r = 110, g = 190, b = 70} )
if isok == false then
  print( 'sdl.fill failed:', tile )
  os.exit()
end

isok, textalpha = sdl.text( 'Alpha', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textalpha )
  os.exit()
end

isok, textbeta = sdl.text( 'Beta', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textbeta )
  os.exit()
end

isok, textgamma = sdl.text( 'Gamma', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textgamma )
  os.exit()
end

isok, textdelta = sdl.text( 'Delta', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textdelta )
  os.exit()
end

isok, textomega = sdl.text( 'Omega', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textomega )
  os.exit()
end

isok, textlambda = sdl.text( 'Lambda', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', textlambda )
  os.exit()
end

isok, texttau = sdl.text( 'Tau', {font = './examples/metro/ubuntu.ttf', size = 12}, {r = 255, g = 255, b = 255} )
if isok == false then
  print( 'sdl.text failed:', texttau )
  os.exit()
end

isok, imagea = sdl.image( './examples/metro/a.png' )
if isok == false then
  print( 'sdl.image failed:', imagea )
  os.exit()
end

isok, imageb = sdl.image( './examples/metro/b.png' )
if isok == false then
  print( 'sdl.image failed:', imageb )
  os.exit()
end

isok, imagec = sdl.image( './examples/metro/c.png' )
if isok == false then
  print( 'sdl.image failed:', imagec )
  os.exit()
end

isok, imaged = sdl.image( './examples/metro/d.png' )
if isok == false then
  print( 'sdl.image failed:', imaged )
  os.exit()
end

sdl.blit( tile, nil, nil, {x = 10, y = 10} )
sdl.blit( tile, nil, nil, {x = 10, y = 230} )
sdl.blit( tile, nil, nil, {x = 120, y = 230} )
sdl.blit( tile, nil, nil, {x = 10, y = 340} )

sdl.blit( imagea, nil, nil, {x = 120, y = 10} )
sdl.blit( imageb, nil, nil, {x = 120, y = 340} )
sdl.blit( imagec, nil, nil, {x = 10, y = 120} )
sdl.blit( imaged, nil, nil, {x = 235, y = 10} )

sdl.blit( textalpha, nil, nil, {x = 20, y = 88} )
sdl.blit( textbeta, nil, nil, {x = 130, y = 88} )
sdl.blit( textgamma, nil, nil, {x = 20, y = 198} )
sdl.blit( textdelta, nil, nil, {x = 20, y = 308} )
sdl.blit( textomega, nil, nil, {x = 130, y = 308} )
sdl.blit( textlambda, nil, nil, {x = 20, y = 418} )
sdl.blit( texttau, nil, nil, {x = 130, y = 418} )

sdl.flip()

sdl.delay( 10000 )

sdl.quit()

print('Done')

-- eof
